Boot Logo and Display Parameter Reference

version 1.3


1. OVERVIEW

This article provides methods to add, delete, and modify the Boot logo in the SDK compilation environment.

Note before changing the logo:

  1. Now, bootlogo only supports jpg image format, because it is software decoding, so the larger the image, the slower the decoding speed. The default bootlogo buffer assigned by the public version is 1M, the resolution of the image needs to meet width*height*1.5\<1M; the size of the image should be small 128KB than the logo partition.

  2. The width of the picture needs to be 16 aligned.


2. BOOT LOGO DISPLAY PRINCIPLE

A set of drivers to decode JPG and display has been implemented in Uboot, which use bootcm to display the BOOT LOGO.

BOOT LOGO display steps are as following:

  1. Grab screen parameters or HDMI/VGA display related information and original JPEG data from the fixed LOGO partition.

  2. Display how many screen parameters data are saved in related information, uboot will find the corresponding screen parameter data according to the name in the current env.

  3. The original JPGE data supports multiple, and the JPGE to be displayed can be dynamically switched according to user parameters.

  4. The display information also provides the buffer address used by uboot for display, as well as the panel resolution and display refresh rate.

  5. Send JPEG RAW data to decoder for decoding.

  6. There are two ways to use the data decoded by the decoder for display. One is to decode the YUV420 data for DISP display, the displayed content is in the video layer, and the other is to decode the ARGB8888 format and send it to GOP, the displayed content is in the graphics layer.

  7. Initialize HDMI and Panel, display BOOT LOGO.

    Figure 2-1


3. MISC AND LOGO PARTITION

Logo supports two partition formats:

  • LOGO partition:

    For detailed introduction of LOGO partition configuration and partition making method, please refer to LOGO partition making.

  • MISC partition:

    MISC partition uses the open-source littlefs file system, which supports reading and writing, and is easy to transplant across platforms. It is supported in rtk, uboot and linux, and the reading speed is very fast, it supports power-down protection and has a good write balance mechanism. So, it can be used to replace the original LOGO partition.

In the misc partition, INI scripts replace the screen parameter data. A set of INI parser code is also integrated in uboot for screen parameter data analysis, which can also be extended to other functional configurations in the future.

The basic configuration of screen parameters is in INI, which is shared with LINUX, so the client only needs to maintain a set of screen parameters.

The following table lists the characteristics of the LOGO partition and MISC partition.

LOGO partition MISC partition
Dynamic support for screen parameter change Y Y
Dynamic modification of screen parameters N Y
Dynamic modification of boot logo image N Y
screen parameter data analysis time (estimated) 55ms 59ms
Whether to share screen parameters with LINUX N Y
Support mount on Linux N Y
Partition size (spinand) 384KB 384KB

The block size used by the littlefs of the MISC partition is 32KB, so for nor flash, it is not advisable to add multiple files in the MISC partition, especially multiple small INI configuration scripts. If necessary, please write all the configurations to an ini configuration Script.

Uboot will first read the current MTD during the boot logo phase Whether there are partitions with "misc" and "logo" in the part, if there is a misc partition, the screen parameter information in the misc partition will be read to light up panel and display the logo, otherwise it will read the relevant information in the LOGO partition information.


4. BOOT LOGO CONFIG


4.1. Enable bootlogo hdmi

  • Uboot:

    Open the following configs:

    CONFIG_CMD_BOOTLOGO
    CONFIG_SSTAR_DISP
    CONFIG_SSTAR_DISP_HDMITX_VGA
    CONFIG_SSTAR_HDMITX
    CONFIG_SSTAR_JPD
    

    If hdmi is used, the CONFIG_ANALOG_PD_HDMI_ATOP of the kernel needs to be turned off, otherwise the logo will disappear when the kernel boots up.


4.2. Enable Bootlogo Panel

  • Uboot:

    Open the following configs:

    CONFIG_CMD_BOOTLOGO
    CONFIG_SSTAR_DISP
    CONFIG_SSTAR_PNL
    CONFIG_SSTAR_JPD
    

4.3. Enable MISC partition & INI Parser(Not currently supported)

  • Uboot:

    Open the following configs:

    CONFIG_FS_LITTLEFS=y
    CONFIG_SSTAR_INI_PARSER=y
    
  • Kernel:

    Build in fuse.

    Figure4-1


5. LOGO PARTITION PRODUCTION


5.1. Basic Structure Of LOGO Partition

Figure5-1

The LOGO partition is divided into partition header and several sub headers.

Partition header stored sub header count and tittle.

Sub header has two kinds of data, one of which is to save the data of screen parameters and HDMI/VGA display parameters. These data are saved in Flash in the form of C language structure. The other is that several Sub headers store Jpeg pictures.

In the display data, Frist_use_offset is used to index the current default screen parameters or the setting of hdmi/vpa.


5.2. Project Boot LOGO Configuration (LOGO partition)

The modification of BOOT LOGO is based on that the LOGO partition has been created, and the display device (display out: panel/HDMI/VGA) has been configured. On this basis, the display device designated in the LOGO partition, the memory address used for display and the file name of the boot LOGO can be modified.

  1. Open build config file to modify the followings:

    BOOTLOGO_FILE = sigmastar1024_600.jpg
    BOOTLOGO_ADDR = E_LX_FB
    DISP_OUT_NAME = SAT070CP50
    
  2. BOOTLOGO_FILE means to use the corresponding file name for logo display under project\board\ini\misc\.

  3. BOOTLOGO_ADDR is used to display the memory address.

  4. DISP_OUT_NAME displays the output name used, how to make it can refer to LOGO PARTITION PRODUCTION.


5.3. LOGO Partition Production Source Code And Tool Usage

Source path generated by LOGO's RAW data partition:

project\image\makefiletools\src\rawgenerator。

Executing make under this path will automatically copy the executable bin to project\image\makefiletools\bin\ to generate the corresponding LOGO image during compilation.

Script generated by LOGO partition:

project\image\image.mk

Figure5-2

The image of LOGO is generated by dispcfggen and logogen, dispcfggen generates display-related parameter data, and logogen generates LOGO data composed of images.

The code path of display data:

project\image\makefiletools\src\rawgenerator\disp_data_main.c

The code path of Jpeg image

project\image\makefiletools\src\rawgenerator\logo_data_main.c

Description of using parameters:

dispcfggen:

-c: create a header for raw data and add displayed subheader and data. If the file specified by -o exists, clear the file.

-a: add a display related subheader and data to the end of the file which have raw data header and data.

-o: specify the output file.

-p: Physical address for display on the board.

-s: display the memory size of the address

-d: display output index name

logogen:

-c: create a header for raw data and add subheader and data for jpeg format files. If the file specified by -o exists, clear the file.

-a: add subheader and data of a jpeg format file to the end of the file which have raw data header and data.

-o: specify the output file.

-i: path of jpeg file.


5.4. Modify Display Data

The display data is divided into two parts, one is screen parameters for panel display, the other is HDMI/VGA display output, these two attributes are mutually exclusive in use, once the user sets DISP_OUT_NAME as the screen parameter The name of the output display data is all screen parameter data. If the name starts with HDMI/VGA, only the parameter data of HDMI/VGA will be output, such as HDMI_1080P60.

5.4.1. Modify Screen Parameter

  1. Screen parameter files can be obtained from FAE, or configured according to relevant documents.

  2. The screen parameter file is an initialized structure data, which is stored in an h file. All screen parameter files used in the public version are stored in project\image\makefiletools\src\rawgenerator\pnl. Note:the data structure name declared in the header file of each screen parameter must not be the same as define, otherwise the compilation will fail.

  3. Modify or add stTable in disp_data_main.c, specify the screen parameter name, data structure and mipi command data structure. Note: ttl has no mipi parameter, so fill in NULL in the mipi column.

    Figure5-3

  4. Screen parameter include:

    Figure5-4

  5. After the above modification is completed, recompile and generate the executable file, the logo image generated by execution file has the added screen parameter, use -d to specify the name of the preferred screen parameter. If the preferred screen parameter is incorrect, modify it by modifying env in uboot. Refer to "Multi-screen parameter and multi-logo switching".

5.4.2. Modify HDMI/VGA Setting

  1. HDMI/VGA only needs to fill in the width and height of the output timing and clock.

  2. The modification method is as follows:

    Figure5-5


5.5. Multi-display Parameter Switching

All the display parameter data is saved in the partition of LOGO, which can be switched by env.

Use the index of display settings in uboot's env ${dispout}. By default, env is empty. After the first power-on, if the bootlogo command is executed in the uboot phase, the name corresponding to the currently used setting will be saved to ${dispout}.

‘Bootlogo’ command execution flow chart:

Figure5-6

As you can see from the figure above, if the environment variable ${dispout} is not specified, the system will set the preferred display parameters by default.When ${dispout} is inconsistent with the preferred display parameter, the system will automatically index the corresponding display parameter according to the value set by ${dispout}.If found, it will be written back to the flash, so that the next boot process will be executed according to the process matching the environment variables.


6. UBoot COMMAND


6.1. Bootlogo Command Introduction

Execute bootlogo [logo index] [aspect ratio] [x] [y] in Uboot.

The four parameters represent:

  1. The digital index of the JPEG packaged in the LOGO.

  2. Display the aspect ratio of logo, 0: zoom, full-screen display, 1: center, center display, 2: user, user sets the starting point, point to point display.

  3. If the aspect ratio is user, x and y represent the starting point of the displayed image.


6.2. LOGO Rotation

Modify env ‘logo_rot’ in uboot, restart after modification, or execute bootlogo command again.

logo_rot = 0 : no rotation

logo_rot = 1 : Rotate 90° clockwise

logo_rot = 2 : Rotate 180° clockwise

logo_rot = 3 : Rotate 270° clockwise

After the LOGO rotation, the upper left corner of the screen is still displayed from (0, 0). The width and height of the image may be exchanged.

Note: The rotated image must be in the displayed area, otherwise the display driver will report an error.


7. sd/usb UPGRADE UI DISPLAY

Open SSTAR UPGRADE UI in uboot. This command depends on SSTAR RGN and SSTAR DISP.

Figure7-1

The UI for SD and USB upgrades consists of a background image and a progress bar.

The UI background image depends on the bootlogo command, and boologo displays the second image as the upgraded UI.

Image path currently used:

project\board\ini\misc\upgrade.jpg

Picture + progress bar display effect:

Figure7-2


8. Linux Use Screen Parameters

Linux code can obtain the current screen parameters by reading the data of the LOGO partition. There is no need to maintain multiple screen parameter header files on the application side, which can increase the versatility of the code. At present, the interface for obtaining screen parameters from flash has not yet been opened.

If the MISC partition is used, the screen parameter file and jpg image will be automatically mounted to the /misc directory, and the application can refer to the introduction in the Panel document on how to use the screen parameter ini file.